<template>
	<view class="container">
		<u-navbar title="占位订单" :autoBack="false" @leftClick="back"></u-navbar>
		<view class="carditem">
			<view class="ddh u-flex u-flex-between">
				<view class="u-line-1" style="flex: 1;">{{$z.$t("订单编号")}}：{{ obj.ddh }}</view>
				<u-button type="primary" v-if='obj.b_zf == 1' text="已完成" style="width: auto; margin: 0"
					size="mini"></u-button>
				<u-button v-else type="error" text="未缴纳" style="width: auto; margin: 0" size="mini"></u-button>
			</view>
			<view class="sj u-flex u-flex-start">
				<view>{{$z.$t("占位开始时间")}}：</view>
				<view>{{ obj.sjs }}</view>
			</view>
			<view class="sj u-flex u-flex-start">
				<view>{{$z.$t("占位结束时间")}}：</view>
				<view>{{ obj.sje }}</view>
			</view>
			<view class="sj u-flex u-flex-start">
				<view>{{$z.$t("占位费计费规则")}}：</view>
				<view>{{ obj.qbf / 100  }}元{{obj.dfsj}}分钟，前{{obj.jebd}}分钟前免费</view>
			</view>
			<view class="sj u-flex u-flex-start">
				<view>{{$z.$t("超时占位时长")}}：</view>
				<view v-if="obj.b_end == 1">{{ obj.cszwsj == 0  ? '-' :formatDuration(obj.cszwsj)}}</view>
				<view v-else>-（计算中）</view>
			</view>
			<view class="sj u-flex u-flex-start">
				<view>{{$z.$t("占位费")}}：</view>
				<view v-if="obj.b_end == 1">{{ obj.je / 100  }}元</view>
				<view v-else>-（计算中，待占位订单结束后展示详情）</view>
			</view>
			<view class="sj u-flex u-flex-start">
				<view>{{$z.$t("站点名称")}}：</view>
				<view>{{ obj.pcsmc}}</view>
			</view>
			<view class="sj u-flex u-flex-start">
				<view>{{$z.$t("设备ID")}}：</view>
				<view>{{ obj.gtel  }}</view>
			</view>
			<view class="sj u-flex u-flex-start">
				<view>{{$z.$t("枪号")}}：</view>
				<view>{{ obj.td == 1 ? 'A枪' : 'B枪'  }}</view>
			</view>
			<view class="sj u-flex u-flex-between" @click="toPlaceholderChargingListPage(obj)">
				<view>
					<text>{{$z.$t("充电时长")}}：</text>
					<text>{{ obj.cdsj == 0 ? '-' : formatDuration(obj.cdsj) }}</text>
				</view>
				<u-icon name="arrow-right"></u-icon>
			</view>
			<view class="sj u-flex u-flex-start" v-if='obj.jesj > 0 || refundList.length > 0'>
				<view>{{$z.$t("支付方式")}}：</view>
				<view>{{obj.b_zf == 0 ? '-' : paymentTypes[obj.zftype] || '-' }}</view>
			</view>
			<view class="sj u-flex u-flex-start" v-if='obj.jesj > 0 || refundList.length > 0'>
				<view>{{$z.$t("支付时间")}}：</view>
				<view>{{ obj.sjzf  }}</view>
			</view>
			<view class="sj u-flex u-flex-start"
				v-if='obj.b_end == 1 && obj.b_zf == 1 && obj.jesj > 0 || refundList.length > 0'>
				<view>{{$z.$t("支付金额")}}：</view>
				<view>{{ obj.jesj / 100  }}元</view>
			</view>
			<!-- 未缴纳 -->
			<view class="sj u-flex u-flex-start" v-if='obj.b_zf == 0'>
				<view>{{$z.$t("支付时间")}}：</view>
				<view>{{$z.$t("待支付")}}</view>
			</view>
			<!-- 修改模板部分 -->
			<view v-if="refundList.length > 0">
				<view style="padding: 15rpx 30rpx 15rpx;">{{$z.$t("退款记录")}}：</view>
				<view class="refund-list">
					<view v-for="(item, index) in refundList" :key="index" class="refund-item">
						<text>{{ item.time }} 已退款 {{ item.amount }}元 </text>
					</view>
				</view>
			</view>
		</view>
		<payment ref="paymentRef" :ChargeCarSys="ChargeCarSys" v-if='obj.b_zf != 1 && obj.b_end == 1'
			v-model="paymentType"></payment>
		<fixedbtn v-if='obj.b_zf != 1 && obj.b_end == 1'>
			<u-button type="primary" :loading="loading" @click="handlePay" text="支付"></u-button>
		</fixedbtn>
		<zmodal ref="zmodal"></zmodal>
	</view>

</template>

<script>
	import qs from "qs"
	import payment from './payment.vue'
	import cdjson from "./sys";
	export default {
		components: {
			payment
		},
		data() {
			return {
				// 1 占位费0元 2 占位费非0  3 占位费非0 并且有退款
				moneyType: 3,
				obj: {},
				paymentType: '',
				ChargeCarSys: {},
				loading: false,
				isShowUnpaidOrder: false,
				paymentTypes: {
					0: '微信支付',
					1: '支付宝支付',
					2: '余额支付',
					3: '卡支付',
					8: '宝付微信支付',
					9: '宝付支付宝支付'
				},
				isShowRefundTime: true,
				refundList: [], // 存储所有退款记录
				gtel: '',
				td: '',
				type: ''
			};
		},
		watch: {
			paymentType(val) {
				console.log('paymentType', val);
			},

		},
		async created() {
			await this.loadRefundData();
		},
		async onLoad(query) {
			if (query.gtel) {
				const params = query.gtel.split("_");
				this.gtel = params[0];
				this.td = params.length > 1 ? parseInt(params[1]) : 0; // 确保转换为数字类型
				this.type = query.type
			}
			console.log('this.type', this.type);
			this.obj = query
			console.log('query', query);
			await this.getParkingLockInfo()
			await this.getData()
			// await this.getRefundData(query.ddh)
		},
		methods: {
			// 修改后的获取退款数据方法
			async loadRefundData() {
				try {
					const DsTkInfo = await this.$z.request("/DsTkInfo", {
						ddh: this.obj.ddh,
					});

					if (DsTkInfo.length === 0) {
						return;
					}

					// 转换数据结构
					this.refundList = DsTkInfo.map(item => ({
						amount: item.je / 100,
						time: item.sjtk || this.$z.$t('无时间记录')
					}));

				} catch (error) {
					console.error('获取退款数据失败:', error);
					this.refundList = [];
				}
			},
			async back() {
				uni.navigateTo({
					url: `/pages/order/order`
				})
				// let minje = this.query.minje || 0;
				// let USearch = await this.$store.dispatch("user/getuser");

				// if (this.isUnpaidOrder) {
				// 	this.$refs.zmodal.init({
				// 		content: this.$z.$t("系统检测到您当前存在未缴纳的占位订单，请支付后再使用。"),
				// 		showcancel: false,
				// 		showconfirm: true,
				// 		title: this.$z.$t("温馨提示"),
				// 		confirmText: this.$z.$t("打开占位订单"),
				// 		confirm: () => {
				// 			uni.reLaunch({
				// 				url: `/pages/order/components/components/placeholderOrderInfo?ddh=${this.unfinishedOrder.ddh}`
				// 			})
				// 		},
				// 		cancel: () => {}
				// 	});
				// }
				// this.$z.back();
			},
			async seachParkingLockOrder() {
				if (!this.$store.state.user.USearch.uUser) {
					await this.$store.dispatch("user/getuser");
				}
				let USearch = this.$store.state.user.USearch;
				let ChargeUserDs = await this.$z.request("/ChargeUserDs", {
					uUser: USearch.uUser,
				});
				this.isShowUnpaidOrder = ChargeUserDs.some(item => item.b_zf == 0 && item.b_end == 1)
			},
			async toPlaceholderChargingListPage(val) {
				let ChargeUserDsToUser = await this.$z.request("/ChargeUserDsToUser", {
					ddhds: val.ddh
				});
				if (ChargeUserDsToUser.length > 0) {
					uni.navigateTo({
						url: `/pages/order/components/components/placeholderChargingList?${qs.stringify(val)}`
					})
				} else {
					this.$u.toast('没有充电订单');
				}

			},
			async getData() {
				let ChargeCarSys = await this.$z.request("/ChargeCarSys", {
					gtel: this.obj.gtel,
				});
				this.ChargeCarSys = ChargeCarSys[0]
			},
			async getParkingLockInfo() {
				let ChargeUserDs = await this.$z.request("/ChargeUserDs", {
					ddh: this.obj.ddh
				});
				this.obj = ChargeUserDs[0]
				// if (this.obj.b_end == 0) {
				// 	this.handleCycle()
				// }
			},
			handleCycle() {
				this.updateParkingFee();
				// // 清除已有定时器
				// if (this.pollingTimer) clearInterval(this.pollingTimer);

				// // 立即计算一次
				// this.updateParkingFee();

				// // 每分钟轮询
				// this.pollingTimer = setInterval(() => {
				// 	if (this.obj.b_zf == 1) {
				// 		clearInterval(this.pollingTimer);
				// 		return;
				// 	}
				// 	this.updateParkingFee();
				// }, 60000); // 60秒
			},

			async updateParkingFee() {
				// 计算当前时长（分钟
				const durationMinutes = this.calculateDuration(this.obj.sjs);
				console.log('充电订单开始时间', this.obj.sjs);
				// 获取费用规则参数
				const freeMinutes = 10; // 免费时长（分钟）
				const unitMinutes = this.obj.dfsj || 30; // 计费单位时长（默认30分钟）
				const unitFee = this.obj.qbf || 0; // 单位费用（分）
				let ChargeUserDsToUser = await this.$z.request("/ChargeUserDsToUser", {
					ddhds: this.obj.ddh
				});
				let isCharingOrder = false
				let totalMinutes = 0
				console.log('ChargeUserDsToUser', ChargeUserDsToUser[0]);
				if (ChargeUserDsToUser.length > 0) {
					// 1. 获取原始数据
					const ddhs = ChargeUserDsToUser.map(item => item.ddh);

					// 2. 并行请求数据（优化性能）
					const requests = ddhs.map(ddh =>
						this.$z.request("/GetRfCD", {
							ddh
						})
					);

					// 3. 合并结果并处理错误
					const results = await Promise.allSettled(requests);
					let allResults = results
						.filter(result => result.status === 'fulfilled')
						.flatMap(result => result.value || []);

					// 4. 确保每条数据都有 sjcde 和 sjcds 字段
					allResults = allResults.map(item => ({
						...item,
						sjcde: item.sjcde || "", // 初始化字段
						sjcds: item.sjcds || ""
					}));

					// 5. 补全缺失的时间字段（当前时间）
					const formatTime = (date) => {
						const pad = num => String(num).padStart(2, '0');
						return `${date.getFullYear()}-${pad(date.getMonth()+1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
					};
					const currentTime = formatTime(new Date());
					allResults = allResults.map(item => ({
						...item,
						sjcde: item.sjcde || currentTime, // 为空时补当前时间
						sjcds: item.sjcds || currentTime
					}));

					// 6. 按开始时间（sjcds）排序
					allResults.sort((a, b) => new Date(a.sjcds) - new Date(b.sjcds));

					// 7. 计算每条记录的 timeDiff（sjcde - sjcds 的分钟差）
					allResults = allResults.map((item, index) => {
						if (!item.sjcds || !item.sjcde) {
							return {
								...item,
								timeDiff: 0
							}; // 无时间数据时返回0
						}

						const start = new Date(item.sjcds);
						const end = new Date(item.sjcde);

						// 调试输出（可选）
						console.log(`记录 ${index}:`, {
							'开始时间': item.sjcds,
							'结束时间': item.sjcde,
							'差值(ms)': end - start,
							'差值(分钟)': Math.floor((end - start) / (1000 * 60))
						});

						return {
							...item,
							timeDiff: Math.floor((end - start) / (1000 * 60)) // 向下取整
						};
					});

					// 8. 计算总时间差（所有记录的 timeDiff 之和）
					totalMinutes = allResults.reduce((sum, item) => sum + item.timeDiff, 0);

					// 9. 输出结果
					console.log('总充电时间（分钟）:', totalMinutes);
					isCharingOrder = true
				}

				// 计算超时时长和费用    durationMinutes是占位订单计算后得出的几分钟 freeMinutes免费时长10分钟
				// let overtimeMinutes = Math.max(0, durationMinutes - freeMinutes);
				let overtimeMinutes = 0
				let fee = 0;
				if (isCharingOrder) {
					// 有订单的总的占位时长 overtimeMinutes占位了几分钟 
					const sumTime = Number(durationMinutes)
					console.log('占位时长', sumTime);
					// 充电时长 totalMinutes 15
					// 免费时长 this.obj.jebd 1
					overtimeMinutes = Number(totalMinutes) + Number(this.obj.jebd) - sumTime >= 0 ? 0 : Math.abs(
						Number(totalMinutes) + Number(this.obj.jebd) - sumTime)
					// console.log('overtimeMinutes', overtimeMinutes, isCharingOrder, this.obj.jebd);
					console.log('免费时长', Number(totalMinutes) + Number(this.obj.jebd));
				}
				if (overtimeMinutes > 0 && isCharingOrder) {
					const chargeUnits = Math.ceil(overtimeMinutes / unitMinutes);
					fee = chargeUnits * unitFee;
				} else {
					const chargeUnits = Math.max(0, durationMinutes - freeMinutes)

					fee = Math.ceil(chargeUnits / unitMinutes) * unitFee;
					console.log('lalla', Math.ceil(chargeUnits / unitMinutes), unitFee);
				}

				// 更新数据
				this.obj = {
					...this.obj,
					cszwsj: isCharingOrder ? overtimeMinutes : Math.max(0, durationMinutes -
						freeMinutes), // 超时时长（分钟）1
					je: fee > this.obj.df ? this.obj.df : fee, // 当前费用（分）
				};
				console.log('fee', fee > this.obj.df, fee);
			},

			calculateDuration(startTimeStr) {
				const start = new Date(startTimeStr);
				const now = new Date();
				return Math.floor((now - start) / (1000 * 60)); // 转为分钟
			},
			// 格式化费用显示（ 分转元）
			formatFee(fen) {
				return (fen / 100);
			},

			// // 格式化时长显示（ xx小时xx分钟）
			// formatDuration(minutes) {
			// 	if (minutes < 60) return `${minutes}分钟`;
			// 	const hours = Math.floor(minutes / 60);
			// 	const mins = minutes % 60;
			// 	return `${hours}小时${mins}分钟`;
			// },
			formatDuration(minutes) {
				if (minutes < 60) {
					return `${minutes}${this.$z.$t('分钟')}`;
				}
				const hours = Math.floor(minutes / 60);
				const remainingMinutes = minutes % 60;
				return `${hours}${this.$z.$t('小时')}${remainingMinutes}${this.$z.$t('分钟')}`;
			},


			// 计算时长辅助方法（分钟）
			calculateDuration(startTimeStr) {
				if (!startTimeStr) return 0;

				const start = new Date(startTimeStr);
				const now = new Date();

				// 处理无效日期
				if (isNaN(start.getTime())) return 0;

				return Math.floor((now - start) / (1000 * 60)); // 转为分钟
			},

			// 格式化显示方法
			formatFee(fen) {
				return (fen / 100).toFixed(2);
			},

			formatDuration(minutes) {
				if (minutes < 60) return `${minutes}分钟`;
				const hours = Math.floor(minutes / 60);
				const mins = minutes % 60;
				return `${hours}小时${mins}分钟`;
			},
			async handlePay() {
				const {
					ddh,
					je
				} = this.obj;
				const {
					USearch
				} = this.$store.state.user;
				const paymentConfigs = {
					USearch: {
						params: {
							ddh,
							je: je
						},
						url: '/DsJE'
					},
					Card: {
						params: {
							ddh,
							je: je,
							printid: USearch.printid
						},
						url: '/DsCard',
						checkBalance: async () => {
							const [card] = await this.$store.dispatch("request/getRequest", {
								url: "/Card",
								data: {
									printid: USearch.printid
								},
							}) || [{
								je: 0
							}];

							if (card.type === 5 && card.je <= 0) {
								this.showModal(this.$z.$t("您的剩余分钟不足"));
								return false;
							}

							if ([1, 3, 4, 6].includes(card.type) && card.je <= 0) {
								this.showModal(this.$z.$t("您的剩余次数不足"));
								return false;
							}
							console.log('card.je', card.je, je);
							return this.checkFunds(Number(card.je), Number(je),
								this.$z.$t("卡余额不足是否充值"),
								`/pages/card/pay/pay?printid=${card.printid}&minje=${je}`
							);
						}
					},
					wx: {
						params: {
							ddh,
							je: je
						},
						url: '/WXDsxd'
					},
					zfb: {
						params: {
							ddh,
							je: je,
							b_app: 0,
							uUser: USearch.uUser
						},
						url: '/AlipayDs'
					}
				};

				const config = paymentConfigs[this.paymentType];
				if (!config) return;
				// 检查余额是否足够
				if (this.paymentType === 'USearch') {
					if (!await this.checkUserBalance(Number(USearch.je), Number(je))) {
						return; // 余额不足，直接显示充值提示
					}
				} else if (this.paymentType === 'Card' && config.checkBalance) {
					if (!await config.checkBalance()) {
						return; // 余额不足，直接显示充值提示
					}
				}
				// 余额足够，显示支付确认弹窗
				this.$refs.zmodal.init({
					content: this.$z.$t(`确认支付占位费${this.obj.je / 100}元吗？`),
					showcancel: true,
					showconfirm: true,
					title: this.$z.$t("提示"),
					confirmText: this.$z.$t("确认"),
					confirm: async () => {
						// 处理移动支付
						if (['wx', 'zfb'].includes(this.paymentType)) {
							await uni.$z.parkingLockPay(config.url, config.params);
							return;
						}
						// 执行支付请求
						const [response] = await uni.$z.request(config.url, config.params);
						this.showResultToast(response.par === "succeed");
					},
					cancel: () => {}
				});

			},

			// 公共方法 - 显示结果提示
			showResultToast(isSuccess) {
				uni.showToast({
					title: this.$z.$t(isSuccess ? "支付成功" : "支付失败"),
					duration: 2000,
					icon: "none",
				});
				if (isSuccess && this.gtel && this.td) {
					if (this.type == 'sys') {
						setTimeout(() => {
							uni.reLaunch({
								url: `/pages/ChargeCarSys/ChargeCarSys?gtel=${this.gtel}_${this.td}`
							})
						}, 1000)

					} else {
						setTimeout(() => {
							uni.reLaunch({
								url: `/pages/parkingLock/parkingLock?gtel=${this.gtel}_${this.td}`
							})
						}, 1000)
					}
				} else {
					this.getParkingLockInfo();
				}
			},

			// 公共方法 - 检查用户余额
			async checkUserBalance(currentBalance, requiredAmount) {
				if (currentBalance < requiredAmount) {
					return this.showRechargeModal(
						this.$z.$t("余额不足是否充值"),
						`/pages/recharge/recharge`
					);
				}
				return true;
			},

			// 公共方法 - 检查资金情况
			checkFunds(current, required, message, rechargeUrl) {
				if (current < required || current === 0) {
					return this.showRechargeModal(message, rechargeUrl);
				}
				if (current < 100) {
					return this.showRechargeModal(
						this.$z.$t("卡余额小于1元是否充值，是否充值?"),
						rechargeUrl
					);
				}
				return true;
			},

			// 公共方法 - 显示充值弹窗
			showRechargeModal(content, url) {
				return new Promise(resolve => {
					this.$refs.zmodal.init({
						content,
						showcancel: true,
						confirmText: this.$z.$t(content.includes("卡") ? "马上充值" : "是"),
						cancelText: this.$z.$t("否"),
						confirm: () => {
							uni.navigateTo({
								url
							});
							resolve(false);
						},
						cancel: () => resolve(false),
					});
				});
			},

			// 公共方法 - 显示简单弹窗
			showModal(content) {
				this.$refs.zmodal.init({
					content
				});
			}
			// async handlePay() {
			// 	let params = {};
			// 	let url = ''
			// 	let USearch = this.$store.state.user.USearch;

			// 	console.log('USearch', USearch);
			// 	if (this.paymentType == 'USearch') {
			// 		params = {
			// 			ddh: this.obj.ddh,
			// 			je: this.obj.qbf
			// 		}
			// 		url = '/DsJE'
			// 	} else if (this.paymentType == 'Card') {
			// 		params = {
			// 			ddh: this.obj.ddh,
			// 			je: this.obj.qbf,
			// 			printid: USearch.printid
			// 		}
			// 		url = '/DsCard'
			// 	} else if (this.paymentType == 'wx') {
			// 		params = {
			// 			ddh: this.obj.ddh,
			// 			je: this.obj.qbf
			// 		}
			// 		url = '/WXDsxd'
			// 	} else if (this.paymentType == 'zfb') {
			// 		params = {
			// 			ddh: this.obj.ddh,
			// 			je: this.obj.qbf,
			// 			b_app: 0,
			// 			uUser: USearch.uUser
			// 		}
			// 		url = '/AlipayDs'
			// 	}

			// 	if (this.paymentType == "wx" || this.paymentType == "zfb") {
			// 		await uni.$z.pay(url, params);
			// 		return;
			// 	}
			// 	if (this.paymentType == "USearch") {
			// 		let yeerrstr = "",
			// 			confirmText = "",
			// 			cancelText = "";
			// 		if (USearch.je < params.je) {
			// 			yeerrstr = this.$z.$t("余额不足是否充值");
			// 			confirmText = this.$z.$t("马上充值");
			// 			cancelText = this.$z.$t("否");
			// 			this.$refs.zmodal.init({
			// 				content: yeerrstr,
			// 				showcancel: true,
			// 				confirmText: confirmText,
			// 				cancelText: cancelText,
			// 				confirm: () => {
			// 					uni.navigateTo({
			// 						url: `/pages/recharge/recharge?minje=${params.je}`,
			// 					});
			// 				},
			// 				cancel: () => {

			// 				},
			// 			});
			// 		} else if (USearch.je <= 100) {
			// 			yeerrstr = this.$z.$t("余额小于1元是否充值，是否充值?");
			// 			confirmText = this.$z.$t("是");
			// 			cancelText = this.$z.$t("否");
			// 			this.$refs.zmodal.init({
			// 				content: yeerrstr,
			// 				showcancel: true,
			// 				confirmText: confirmText,
			// 				cancelText: cancelText,
			// 				confirm: () => {
			// 					uni.navigateTo({
			// 						url: `/pages/recharge/recharge?minje=${params.je}`,
			// 					});
			// 				},
			// 				cancel: () => {

			// 				},
			// 			});
			// 		}
			// 	} else if (this.paymentType == "Card") {
			// 		let card = await this.$store.dispatch("request/getRequest", {
			// 			url: "/Card",
			// 			data: {
			// 				printid: USearch.printid,
			// 			},
			// 		});
			// 		card = card[0] || {
			// 			je: 0,
			// 		};

			// 		if (card.type == 5) {
			// 			if (card.je <= 0 || !card.je) {
			// 				this.$refs.zmodal.init({
			// 					content: this.$z.$t("您的剩余分钟不足"),
			// 				});
			// 			}

			// 		} else if ([1, 3, 4, 6].indexOf(Number(card.type)) >= 0) {
			// 			if (card.je <= 0 || !card.je) {
			// 				this.$refs.zmodal.init({
			// 					content: this.$z.$t("您的剩余次数不足"),
			// 				});
			// 			}

			// 		} else {
			// 			// console.log(card,reqdata);
			// 			if (card.je < params.je || card.je == 0) {
			// 				this.$refs.zmodal.init({
			// 					content: this.$z.$t("卡余额不足是否充值"),
			// 					showcancel: true,
			// 					confirmText: this.$z.$t("马上充值"),
			// 					cancelText: this.$z.$t("否"),
			// 					confirm: () => {
			// 						uni.navigateTo({
			// 							url: `/pages/card/pay/pay?printid=${card.printid}&minje=${params.je}`,
			// 						});
			// 					},
			// 					cancel: () => {},
			// 				});

			// 			} else if (card.je < 100) {
			// 				this.$refs.zmodal.init({
			// 					content: this.$z.$t("卡余额小于1元是否充值，是否充值?"),
			// 					showcancel: true,
			// 					confirmText: this.$z.$t("是"),
			// 					cancelText: this.$z.$t("否"),
			// 					confirm: () => {
			// 						uni.navigateTo({
			// 							url: `/pages/card/pay/pay?printid=${card.printid}&minje=${params.je}`,
			// 						});
			// 					},
			// 					cancel: () => {},
			// 				});
			// 			}
			// 		}
			// 	}
			// 	let par = await uni.$z.request(url, params);

			// 	if (par[0].par == "succeed") {
			// 		uni.showToast({
			// 			title: this.$z.$t("支付成功"),
			// 			duration: 2000,
			// 			icon: "none",
			// 		});
			// 		this.getParkingLockInfo()
			// 	} else {
			// 		uni.showToast({
			// 			title: this.$z.$t("支付失败"),
			// 			duration: 2000,
			// 			icon: "none",
			// 		});
			// 	}
			// },
		}
	}
</script>

<style lang="scss">
	.container {
		width: 100%;
		height: 100vh;
		background-color: #f4f7f8;
		padding: 30rpx;
	}

	/* 添加样式 */
	.refund-list {
		flex: 1;
		margin-left: 20rpx;
	}

	.refund-item {
		padding: 8rpx 10rpx;
		// border-bottom: 1rpx solid #eee;


		&:last-child {
			border-bottom: none;
			padding-bottom: 20rpx;
		}
	}

	.carditem {
		background: #fff;
		// margin: 30rpx;
		border-radius: 10rpx;

		.ddh {
			height: 60rpx;
			font-size: 30rpx;
			position: relative;
			padding: 0 30rpx;

			// &::after {
			// 	content: "";
			// 	position: absolute;
			// 	left: 30rpx;
			// 	bottom: 0;
			// 	height: 1rpx;
			// 	background: #e5e5e5;
			// 	right: 30rpx;
			// }
		}

		.btn {
			padding: 20rpx 20rpx 30rpx 20rpx;
		}

		.sj {
			height: 60rpx;
			font-size: 28rpx;
			position: relative;
			padding: 0 30rpx;

			// &::after {
			// 	content: "";
			// 	position: absolute;
			// 	left: 30rpx;
			// 	bottom: 0;
			// 	height: 1rpx;
			// 	background: #e5e5e5;
			// 	right: 30rpx;
			// }
		}

		.je {
			height: 120rpx;
			justify-content: flex-end;
			padding: 0 30rpx;
			font-size: 24rpx;

			.text {
				font-size: 36rpx;
				font-weight: bold;
				color: #2093f5;
			}
		}
	}
</style>